package xj.toolkit.base;

import xj.toolkit.util.MutablePropertyable;

public class TransportUtils {

	private static final String TRANSPORT_SENDER = "TRANSPORT_SENDER";

	public static <T> void attachSender(MutablePropertyable<String, Object> mutablePropertyable, Sender<T> sender) {
		mutablePropertyable.setProperty(TRANSPORT_SENDER, sender);
	}

	@SuppressWarnings("unchecked")
	public static <T> Sender<T> getSenderOf(MutablePropertyable<String, Object> propertyable) {
		return (Sender<T>) propertyable.getProperty(TRANSPORT_SENDER);
	}
}
